Component({
    properties: {
        placeholder: String,
        placeholderStyle: String,
        inputStyle: String,
        cursorSpacing: {
            type: String,
            value: "0"
        },
        confirmType: {
            type: String,
            value: "done"
        },
        confirmHold: {
            type: Boolean,
            value: !1
        },
        name: {
            type: String,
            value: "value"
        },
        disabled: {
            type: Boolean,
            value: !1
        },
        autoFocus: {
            type: Boolean,
            value: !1
        },
        type: {
            type: String,
            value: "text"
        },
        maxLength: {
            type: Number,
            value: -1
        },
        value: {
            type: String,
            value: "",
            observer: function(t) {
                this.setData({
                    content: t
                });
            }
        }
    },
    data: {
        content: "",
        showClear: !1
    },
    methods: {
        onInput: function(t) {
            var e = t.detail.value;
            this.setData({
                content: e
            }), this.onFocus(), this.$emit("input");
        },
        onClear: function() {
            this.setData({
                content: ""
            }), this.onFocus(), this.$emit("input");
        },
        onFocus: function() {
            var t = this.data.content;
            this.setData({
                showClear: !!t
            });
        },
        onBlur: function() {
            this.setData({
                showClear: !1
            });
        },
        onConfirm: function() {
            this.$emit("confirm");
        },
        $emit: function(t) {
            var e = this.data, n = e.content, a = e.name;
            this.triggerEvent(t, {
                name: a,
                value: n
            }, {});
        }
    }
});